import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/allocation/getList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/allocation/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (allocationIds,quotaIds) => {
  return request({
    url: '/api/allocation/remove',
    method: 'post',
    params: {
      allocationIds,quotaIds
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/allocation/save',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/allocation/update',
    method: 'post',
    data: row
  })
}

export const getListByYear = (current, size, params) => {
  return request({
    url: '/api/setting/getListByYear',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getZrren = () => {
  return request({
    url:"/api/riskPoint/riskmanagement/getInternalStaff",
    method: 'get'
  })
}

export const getDeptByUser = (userId) => {
  return request({
    url: "/api/allocation/getDeptByUser",
    method: "get",
    params: {
      userId
    }
  })
}

export const getExamineList = (current, size, params) => {
  return request({
    url: '/api/allocation/getExamineList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
